home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / DLGCONS.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  3.6 KB  |  211 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // DialogClass
  8. //
  9.  
  10. #include "fli.h"
  11. #include "colors.h"
  12.  
  13. #ifdef __BCPLUSPLUS__
  14. #pragma hdrstop
  15. #endif
  16.  
  17. #include <alloc.h>
  18.  
  19. int DialogClass::DialogTimer=16;
  20.  
  21. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  22. //
  23. // DialogClass Constructors
  24. //
  25. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  26.  
  27. DialogClass::DialogClass(int Width,int Height,char *Title,int CloseIcon)
  28. {
  29.   CheckBigCursor=IsBigCursor;
  30.   CheckVisible=Blaze.CheckVisible();
  31.  
  32.   Blaze.GetXY(PreXSave,PreYSave);
  33.  
  34.   TopTitle=Title;
  35.  
  36.   Grouped=0;
  37.   HeadingStorage=0;
  38.   HeadingCount=0;
  39.   MultiTask=0;
  40.   ActionTimer=0;
  41.   BottomSave=0;
  42.   LocatedFirst=0;
  43.   LastPresent=0;
  44.   XSave=0;
  45.   YSave=0;
  46.   UseAction=0;
  47.   NoDefaults=0;
  48.   GroupLock=0;
  49.  
  50.   AlreadyShown=0;
  51.  
  52.   First=0;
  53.   Last=0;
  54.   Current=0;
  55.  
  56.   Event::CloseIcon=CloseIcon;
  57.  
  58.   int Top=(Blaze.WhatHeight()-Height)/2;
  59.   int Left=(Blaze.WhatWidth()-Width)/2;
  60.  
  61.   !Blaze;
  62.   +Blaze;
  63.  
  64.   SpecifyWindow(Left,Top,Width,Height);
  65.   Blaze.Window(Left,Top,Width,Height);
  66.  
  67.   ShowDialogBox();
  68.  
  69.   MouseHide();
  70.  
  71.   Blaze.EraseArea(1,1,Width-2,Height-2,Colors.DiaInterior);
  72.   Blaze.Window(Left+1,Top+1,Width-2,Height-2);
  73.  
  74.   MouseShow();
  75. }
  76.  
  77. DialogClass::DialogClass(int X,int Y,int Width,int Height,char *Title,int CloseIcon)
  78. {
  79.   CheckBigCursor=IsBigCursor;
  80.   CheckVisible=Blaze.CheckVisible();
  81.  
  82.   Blaze.GetXY(PreXSave,PreYSave);
  83.  
  84.   TopTitle=Title;
  85.  
  86.   Grouped=0;
  87.   HeadingStorage=0;
  88.   HeadingCount=0;
  89.   MultiTask=0;
  90.   ActionTimer=0;
  91.   BottomSave=0;
  92.   LocatedFirst=0;
  93.   LastPresent=0;
  94.   XSave=0;
  95.   YSave=0;
  96.   UseAction=0;
  97.   NoDefaults=0;
  98.  
  99.   AlreadyShown=0;
  100.  
  101.   Event::CloseIcon=CloseIcon;
  102.  
  103.   First=0;
  104.   Last=0;
  105.   Current=0;
  106.   GroupLock=0;
  107.  
  108.   int Top=Y;
  109.   int Left=X;
  110.  
  111.   if (X+Width>Blaze.WhatWidth())
  112.     Left=Blaze.WhatWidth()-Width;
  113.   if (Y+Height>Blaze.WhatHeight()-2)
  114.     Top=Blaze.WhatHeight()-Height-1;
  115.  
  116.   !Blaze;
  117.   +Blaze;
  118.  
  119.   SpecifyWindow(Left,Top,Width,Height);
  120.   Blaze.Window(Left,Top,Width,Height);
  121.  
  122.   ShowDialogBox();
  123.  
  124.   MouseHide();
  125.  
  126.   Blaze.EraseArea(1,1,Width-2,Height-2,Colors.DiaInterior);
  127.   Blaze.Window(Left+1,Top+1,Width-2,Height-2);
  128.  
  129.   MouseShow();
  130. }
  131.  
  132. DialogClass::DialogClass()
  133. {
  134.   CheckBigCursor=IsBigCursor;
  135.   CheckVisible=Blaze.CheckVisible();
  136.  
  137.   Blaze.GetXY(PreXSave,PreYSave);
  138.  
  139.   MouseHide();
  140.  
  141.   Grouped=0;
  142.   HeadingStorage=0;
  143.   HeadingCount=0;
  144.   MultiTask=0;
  145.   ActionTimer=0;
  146.   BottomSave=0;
  147.   LocatedFirst=0;
  148.   LastPresent=0;
  149.   XSave=0;
  150.   YSave=0;
  151.   UseAction=0;
  152.   NoDefaults=0;
  153.   CloseIcon=0;
  154.  
  155.   AlreadyShown=0;
  156.  
  157.   TopTitle=0;
  158.  
  159.   First=0;
  160.   Last=0;
  161.   Current=0;
  162.  
  163.   Width=Blaze.WhatWidth();
  164.   Height=Blaze.WhatHeight();
  165.   SpecifyWindow(0,0,Width,Height);
  166.   Blaze.Window(0,0,Width,Height);
  167.  
  168.   MouseShow();
  169.  
  170.   !Blaze;
  171.   +Blaze;
  172. }
  173.  
  174. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  175. //
  176. // DialogClass Destructor
  177. //
  178. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  179.  
  180. DialogClass::~DialogClass()
  181. {
  182.   if (First)
  183.   {
  184.     Current=First;
  185.     do
  186.     {
  187.       DialogElement *Save=Current;
  188.       Current=Current->Next;
  189.       delete Save;
  190.     }
  191.     while (Current);
  192.   }
  193.  
  194.   if (HeadingStorage)
  195.     free(HeadingStorage);
  196.  
  197.   if (BottomSave)
  198.   {
  199.     Blaze.PutArea(0,Blaze.WhatHeight()-1,BottomSave);
  200.     delete BottomSave;
  201.   }
  202.  
  203.   Blaze.GotoXY(PreXSave,PreYSave);
  204.   Blaze.BigCursor(CheckBigCursor);
  205.   if (CheckVisible)
  206.     Blaze.VisibleCursor();
  207.   else
  208.     Blaze.InvisibleCursor();
  209. }
  210.  
  211.